 %include header libraryName=libraryName
    <script type="text/javascript">
        //<!--
        $(document).ready(function() {
            $('#isbn').focus();
        })
        //-->
    </script>
    <h2>Resource Listing ({{len(resources)}} resources)</h2>
    <h3>{{message}}</h3>
    
    <a href="/administration">Administration Home</a>
    <div class="bordered">
        <form name="add_resource_form" method="post" action="/administration/addResourceStep2">
            <label for="isbn">Add Resource by ISBN (may be blank): <input id="isbn" name="isbn" type="text" /></label>
            <button type="submit">Next ></button>
        </form>
        
        <hr />
        
        <table width="100%">
            <thead>
                <tr>
                    <th />
                    <th />
                    <th>ISBN</th>
                    <th>Title</th>
                    <th>Author</th>
                    <th>Publisher</th>
                    <th>Type</th>
                    <th />
                </tr>
            </thead>
            <tbody>
            %for i, resource in zip(range(len(resources)), resources):
                <tr>
                  <td><a href="manageResource/{{resource.get('id')}}"><button>Edit</button></a></td>
                  <td><a href="deleteResource/{{resource.get('id')}}"><button>Delete</button></a></td>
                  <td>{{resource.get('isbn')}}</td>
                  <td>{{resource.get('title', '').encode('utf-8')}}</td>
                  <td>{{resource.get('author', '').encode('utf-8')}}</td>
                  <td>{{resource.get('publisher', '').encode('utf-8')}}</td>
                  <td>{{resourceTypes[resource.get('resource_type_id', '')].encode('utf-8')}}</td>
                  <td class="{{'in' if resourceAvailability[resource.get('id')] else 'out'}}">{{'Available' if resourceAvailability[resource.get('id')] else 'Checked Out'}}</td>
                </tr>
            %end
            </tbody>
        </table>
        <div><a href="/logout">Logout</a></div>
    </div>
%include footer
